package com.hzncc.scaffold.bean;

import cn.hutool.crypto.Mode;
import cn.hutool.crypto.Padding;
import cn.hutool.crypto.symmetric.AES;
import org.bouncycastle.operator.bc.BcAESSymmetricKeyUnwrapper;
import org.springframework.security.crypto.bcrypt.BCrypt;

import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import java.util.Arrays;

/**
 * @Author: DrunkBear
 * @Date: 2022-05-23 15:40
 * @Description: null
 */
public class test {

//    public static void main(String[] args) {
//        String gensalt = BCrypt.gensalt();
//        boolean checkpw = BCrypt.checkpw("wyt", "$2b$10$CJEgKPy0qsiE/LAHon9.LuVZ2lq9Byi9237LwwqWO.PgCfXjeZjma");
//
//        String wyt = BCrypt.hashpw("wyt", gensalt);
//        System.out.println(checkpw);
//        System.out.println(wyt);
//    }

    //AES加密
    public static void main(String[] args) {
        AES aes = new AES(Mode.CBC,Padding.PKCS5Padding,"w2SIy2Hx%2i!tTCd-ikwHEv_kQmB58xI".getBytes(),"R7#54X&gLB!6Q&s=".getBytes());
        String content = "ceshishuju";

        String encryptHex = aes.encryptHex(content);
        System.out.println(encryptHex);
    }
}
